<template>
  <a
    class="tw-item-info"
    @click="linkTo()">
    <div class="tw-item-info__layout">
      <img :src="imgSrc" alt="user">
      <p>{{label}}</p>
      <p>{{number}}</p>
    </div>
  </a>
</template>

<script scoped>
export default{
  props: ['type', 'label', 'number', 'url'],
  computed: {
    imgSrc: function () {
      return `/static/weishidataview/images/icon-${this.type}.png`
    }
  },
  methods: {
    linkTo: function () {
      if (this.url) {
        this.$router.push(`/${this.url}`)
      }
    }
  }
}
</script>

<style scoped></style>
